deactivateConnection(activeConnection) {
this._client.deactivate_connection(activeConnection, null);
}
-
- getIndicatorIcon() {
- for (const item of this._items.values()) {
- if (item.is_active)
- return item.icon_name;
- }
- return '';
- }
});
const NMDeviceSection = GObject.registerClass(
_init() {
super._init();
- this._primaryIndicator = this._addIndicator();
- this._vpnIndicator = this._addIndicator();
-
this._connectivityQueue = new Set();
this._mainConnection = null;
this.menu.addMenuItem(section.menu);
});
+ this._primaryIndicator = this._addIndicator();
+ this._vpnIndicator = this._addIndicator();
+
+ this._vpnSection.bind_property('checked',
+ this._vpnIndicator, 'visible',
+ GObject.BindingFlags.SYNC_CREATE);
+ this._vpnSection.bind_property('icon-name',
+ this._vpnIndicator, 'icon-name',
+ GObject.BindingFlags.SYNC_CREATE);
+
this._getClient().catch(logError);
}
this._primaryIndicator.icon_name = 'network-wired-no-route-symbolic';
}
}
-
- this._vpnIndicator.icon_name = this._vpnSection.getIndicatorIcon();
- this._vpnIndicator.visible = this._vpnIndicator.icon_name !== null;
}
});